<template>
	<view>
		<cu-custom bgColor="bg-gradual-pink" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">视频详情</block>
		</cu-custom>
		<view class="cu-bar bg-white solid-bottom">
			<view class="action">
				<text class="cuIcon-titles text-orange"></text>{{vod.vod_name}}
			</view>
		</view>
		<view class="cu-card case" :class="no-card">
			<view class="cu-item shadow">
				<view class="image">
					<image :src="vod.vod_pic" mode="widthFix"></image>
					<view class="cu-tag bg-blue">{{vod.vod_class}}</view>
					<view class="cu-bar bg-shadeBottom"> <text class="text-cut">{{vod.vod_blurb}}</text></view>
				</view>
				<view class="cu-list menu-avatar">
					<view class="cu-item">
						<view class="content flex-sub">
							<view class="text-grey">{{vod.vod_time}}</view>
							<view class="text-gray text-sm flex justify-between">
								{{vod.vod_actor}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="padding-xl">
			<button class="cu-btn block line-orange lg" @click="playVideo(vod.vod_play_url_list[0])">
				<text class="cuIcon-playfill"></text> 播放</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isCard: false,
				vod:{}
			};
		},
		methods: {
			IsCard(e) {
				this.isCard = e.detail.value
			},
			getVideoInfos: function(data) {
				console.log(data);
				var that = this;
				that.http.sendRequest("/video/" + data, 'get', {}, {
					"Content-Type": "application/json;charset=UTF-8"
				}).then(function(res) {
					if (res.code == 0) {
						console.log(res.data);
						that.vod=res.data[0];
						console.log(that.vod);
						//that.subjects=that.subjects.concat(JSON.parse(res.data));
					}
				})
			},
			playVideo:function(url){
				uni.navigateTo({
					url:"play?url="+url
				})
			}
		},
		onLoad(res) {
			console.log(res.data);
			this.getVideoInfos(res.data);
		}
	}
</script>

<style>

</style>
